#!/usr/bin/perl
#This function uses the parameters and prints the final result for any particular test case involving the INPUT chain.
sub pass_or_fail_remote{
	my($tc_s_or_fail,$tc_id,$index_for_count,$cmd_nt_found,$flag_for_cmd_error,$setup_s_or_f,$clear_s_or_f) = @_;
	$flag_NA = 0;
	$flag_FAIL = 0;
	$flag_PASS = 0;
	$flag_NA = 0;
	$flag_NA_SETUP = 0;
	$flag_NA_CLEAR = 0;
	$flag_NA_check = 0;
	if ($cmd_nt_found == 2){
		print("Result: N.A.\n");
		$flag_NA = 1;
		$flag_NA_check = 1;
	}
	if ($flag_for_cmd_error == 2){
		print("Result: N.A.\n");
		$flag_NA = 1;
		$flag_NA_check = 1;
	}
	if ($setup_s_or_f == 2){
		print("Result: N.A.\n");
		$flag_NA = 1;
		$flag_NA_SETUP = 1;
	}
	if ($clear_s_or_f == 2){
		$flag_NA_CLEAR = 1;
	}
	if ($flag_NA == 0){
		if ($tc_s_or_fail == 1){
			print("Result: Test case PASSED\n\n");
			$flag_PASS = 1;
		}
		else{
			print("Result: Test case FAILED\n\n");
			$flag_FAIL = 1;
		}
	}
	if ($flag_NA_SETUP == 1){
		$final_report = "Test case ID: $tc_id --> N.A. Reason: Table rule not configured properly"
	}
	if ($flag_NA_check == 1){
		$final_report = "Test case ID: $tc_id --> N.A. Reason: Not able to send ping"
	}
	if ($flag_FAIL == 1){
		$final_report = "Test case ID: $tc_id --> FAIL";
	}
	if ($flag_PASS == 1){
		if ($flag_NA_CLEAR == 1){
			$final_report = "Test case ID: $tc_id --> PASS. Comment: Cleardown not executed properly";
		}
		else{
			$final_report = "Test case ID: $tc_id --> PASS";
		}
	}
	$index_for_count = $index_for_count + 1;
	return($final_report,$index_for_count);
}
1;
